1. INTRODUCTION

Linen is a flax-based textile that is predominantly used for homeware applications. While linen is similar to cotton, it is made from fibers derived from the stems of the flax plant instead of the bolls that grow around cotton seeds. Garments made of linen are desirable in hot and humid climates. Unlike cotton, which tends to retain moisture for a significant period of time, linen dries quickly, which helps reduce heat retention in overly warm conditions.

Automatic fabric inspection is important to maintain the quality of fabric. It is desirable to produce the highest quality goods in the shortest amount of time possible. Fabric faults or defects are responsible for nearly 85% of the defects found by the garment industry. Manufacturers recover only 45-65 % of their profits from seconds or off-quality goods. It is imperative, therefore, to detect, to identify, and to prevent these defects from reoccurring. An automated inspection system usually consists of a computer-based vision system. Because they are computer-based, these systems do not suffer the drawbacks of human visual inspection.

2. BACKGROUND INFORMATION

There are several different approaches to apply quality control on images of linens:

2.1 Statistical Approaches

2.1.a Gray level thresholding approach

These approaches are direct and simple mean to detect high contrast fabric defects. The principle depends on the signal variation (peak or trough) due to the presence of high contrast defect.

2.1.b Normalized cross-correlation approach

Correlation is used to locate features in one image that appear in another one and the correlation coefficient can generate a correlation map for defect declaration. The cross-correlation function provides a direct and accurate measure of similarity between two images. Any significant variation in the value of this measure indicates the presence of a defect.

2.1.c Statistical moments approach

Mean, standard deviation, skewness and kurtosis provide statistical information over a region while the values are used for image segmentation.

2.1.d Rank-order functions approach

An image rank-function is a simple statistical approach for defect detection based on histogram analysis. It is given by the sequence of gray levels in the histogram when this sequence is sorted in the ascending order. The histogram and the rank function provide exactly the same information.

2.1.e Edge detection approach

Edge detection is a traditional technique for image analysis. The distribution of edge amount per unit area is an important feature in the textured images. The amount of gray level transitions in the fabric image can represent lines, edges, point defects and other spatial discontinuities. Thus these features have been largely employed for conformity testing, assembly inspection and fabric defect detection.

2.1.f Morphological operations approach

The mathematical morphology helps describing the geometrical and structural properties of an image. Morphological image processing has relevance to conditioning, labeling, grouping, extracting, and matching operations on images. The morphological operations are one of the ideal tools for removing noise, in spatially filtered images of fabrics.

2.1.g Local linear transforms approach

This approach is closely related to filter bank analysis methods. It gives a statistical justification for the extraction of texture properties by means of convolution operators (masks). These masks may be considered as local detectors elementary structures such as defects.

2.1.h Artificial neural-networks approach

The Artificial neural-networks are among the fastest and most flexible classifiers used for fault detection due to their non- parametric nature and ability to describe complex decision transform. If the window function is Gaussian, the windowed regions composed of a number of similar elementary processing units (neurons) connected together into a network. These neurons are arranged in layers with the input data initializing the processing at the input layer.

2.2 Structural Approaches

2.2.a Fourier analysis approach

The Fourier analysis is a global approach that characterizes the textured image in terms of frequency components. Fourier techniques have desirable properties of noise immunity, translation invariance and the optimal characterization (enhancement) of the periodic features. To implement Fourier analysis for fabric defect detection, various methods are available; Optical Fourier Transforms (OFT) obtained in optical domain by using lenses and spatial filters can be used, but most techniques, digitally implemented, are derived from Discrete Fourier Transforms (DFT) and/or its Inverse (IDFT) which recovers the images in the spatial domain.

2.2.b Gabor filters approach

The classical way of introducing spatial dependency into Fourier analysis is through the windowed Fourier transform. If the window function is Gaussian, the windowed Fourier transform becomes the well-known Gabor transform, which can arguably achieve optimal localization in the spatial and frequency domains.

2.3 Model Based Approaches

2.3.a Gauss-Markov random field (GMRF) model approach

The image is simply random noise, Markov random fields use a precise model of this dependence. They are able to capture the local (spatial) contextual information in an image. These models assume that the intensity at each pixel in the image depends on the intensities of only the neighboring pixels. The theory provides a convenient and consistent way for modeling context dependent entities such as pixels, through characterizing mutual influences among such entities using condition MRF distribution.

2.3.b Poisson’s model approach

The stochastic models of some randomly industrial textured materials are based on the nature of the manufacturing process. One example of such material is the fibrous, non-woven material used for air filtration that is manufactured through adhesive technology.

3. APPROACH

In this problem, I have decided to use “Gabor Filter” before applying control charts on sample line pictures. The reason I have chosen Gabor Filter is that it is easy to apply in R via “wvtool” package. This package includes gabor.filter() function which does the intended job. After applying the Gabor Filter, I have decided to create X-bar control charts with the respective rows or columns of sample images. I have chosen the rows or columns by looking the general structure of the sample linen image. If the image is oriented horizontally, I have used the row approach and if the image is oriented vertically, I have used the column approach.

Image 1

library(jpeg)
library(wvtool)
img <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric1.jpg")
gaborfiltered<-gabor.filter(img,30,0,3,0,1,TRUE)

img2 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img2[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img2[i,j] > rowsucl | img2[i,j] < rowslcl){
      img2[i,j] <- 0}}}
which(img2 == 0)
##  [1]      1      2      3  72175  72686  72688 121627 121628 122348 122859
## [11] 123882 124905 126952 128487 191855 191856 192369 249921 250432 255488
## [21] 256004 257029

Image 2

img3 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric2.jpg")
gaborfiltered<-gabor.filter(img3,30,0,3,0,1,TRUE)

img4<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img4[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img4[j,i] > columnsucl | img4[j,i] < columnslcl){
      img4[j,i] <- 0}}}
which(img4 == 0)
##    [1]    243    755   1268   1780   2292   2804   3317  12760  13271
##   [10]  13783  14294  14806  15318  15831  16343  16855  30438  30949
##   [19]  31461  31973  32485  32997  33508  34020  34532  35044  35556
##   [28]  36068  36580  37092  37604  37608  38116  38119  38628  38631
##   [37]  39140  39143  39652  39654  40164  40166  40676  40678  41188
##   [46]  41190  41700  41702  42212  42214  42724  42726  43236  43238
##   [55]  43748  43750  44260  44262  44264  44772  44774  44776  45284
##   [64]  45286  45288  45797  45798  45800  46309  46310  46312  46821
##   [73]  46822  46824  47333  47334  47336  47845  47846  47848  48357
##   [82]  48358  48360  48869  48870  48872  49381  49382  49384  49893
##   [91]  49894  49897  50405  50406  50917  50918  51429  51430  51941
##  [100]  51942  52453  52455  52965  52967  53477  53479  53989  53991
##  [109]  54501  54503  55013  55015  55525  55527  56037  56039  56549
##  [118]  56551  57061  57063  57573  57575  58085  58087  58597  58599
##  [127]  59109  59111  59621  59623  60132  60135  60644  60647  61156
##  [136]  61159  61668  61671  62180  62183  62692  62695  63204  63207
##  [145]  63716  63719  64228  64231  64740  64743  65252  65255  65764
##  [154]  65766  66276  66278  66788  66790  67300  67302  67812  67814
##  [163]  68324  68326  68329  68836  68838  68840  69348  69350  69352
##  [172]  69860  69862  69864  70372  70374  70376  70884  70886  70887
##  [181]  71396  71398  71399  71908  71910  71911  72420  72422  72423
##  [190]  72425  72932  72933  72935  72937  73444  73445  73447  73448
##  [199]  73956  73957  73959  73960  74468  74469  74471  74472  74980
##  [208]  74981  74982  74984  75492  75493  75494  75496  76004  76005
##  [217]  76006  76008  76516  76517  76518  76520  77028  77029  77030
##  [226]  77032  77540  77541  77542  77544  78052  78053  78054  78056
##  [235]  78564  78566  78567  78568  79076  79078  79079  79080  79589
##  [244]  79590  79591  79592  80101  80102  80103  80104  80613  80614
##  [253]  80615  80616  81125  81126  81127  81128  81637  81638  81639
##  [262]  81640  82149  82150  82151  82152  82661  82662  82663  82664
##  [271]  83173  83174  83175  83176  83685  83686  83687  83688  84197
##  [280]  84198  84199  84200  84709  84710  84711  84712  85221  85222
##  [289]  85223  85224  85733  85734  85735  85736  85738  86245  86246
##  [298]  86247  86248  86249  86757  86758  86759  86760  86761  87269
##  [307]  87270  87271  87272  87273  87781  87782  87783  87784  87785
##  [316]  88293  88294  88295  88296  88297  88805  88806  88807  88808
##  [325]  88809  89317  89318  89319  89320  89321  89829  89830  89831
##  [334]  89832  89833  90341  90342  90343  90344  90345  90346  90853
##  [343]  90854  90855  90856  90857  90858  91365  91366  91367  91368
##  [352]  91369  91370  91877  91878  91879  91880  91881  91882  92389
##  [361]  92390  92391  92392  92393  92394  92901  92902  92903  92904
##  [370]  92905  92906  93413  93414  93415  93416  93417  93418  93925
##  [379]  93926  93927  93928  93929  93930  94436  94437  94438  94439
##  [388]  94440  94441  94442  94948  94949  94950  94951  94952  94953
##  [397]  94954  95460  95461  95462  95463  95464  95465  95466  95972
##  [406]  95973  95974  95975  95976  95977  95978  96484  96485  96486
##  [415]  96487  96488  96489  96490  96996  96997  96998  96999  97000
##  [424]  97001  97002  97003  97508  97509  97510  97511  97512  97513
##  [433]  97514  97515  98020  98021  98022  98023  98024  98025  98026
##  [442]  98027  98532  98533  98534  98535  98536  98537  98538  98539
##  [451]  99044  99045  99046  99047  99048  99049  99050  99051  99556
##  [460]  99557  99558  99559  99560  99561  99562  99563 100068 100069
##  [469] 100070 100071 100072 100073 100074 100075 100580 100581 100582
##  [478] 100583 100584 100585 100586 100587 101093 101094 101095 101096
##  [487] 101097 101098 101099 101100 101605 101606 101607 101608 101609
##  [496] 101610 101611 101612 102117 102118 102119 102120 102121 102122
##  [505] 102123 102124 102629 102630 102631 102632 102633 102634 102635
##  [514] 102636 103141 103142 103143 103144 103145 103146 103147 103148
##  [523] 103653 103654 103655 103656 103657 103658 103659 103660 104165
##  [532] 104166 104167 104168 104169 104170 104171 104172 104677 104678
##  [541] 104679 104680 104681 104682 104683 104684 105189 105190 105191
##  [550] 105192 105193 105194 105195 105196 105701 105702 105703 105704
##  [559] 105705 105706 105707 105708 106213 106214 106215 106216 106217
##  [568] 106218 106219 106220 106725 106726 106727 106728 106729 106730
##  [577] 106731 106732 107237 107238 107239 107240 107241 107242 107243
##  [586] 107244 107749 107750 107751 107752 107753 107754 107755 107756
##  [595] 108261 108262 108263 108264 108265 108266 108267 108773 108774
##  [604] 108775 108776 108777 108778 108779 109285 109286 109287 109288
##  [613] 109289 109290 109291 109798 109799 109800 109801 109802 109803
##  [622] 109804 110310 110311 110312 110313 110314 110315 110822 110823
##  [631] 110824 110825 110826 110827 111334 111335 111336 111337 111338
##  [640] 111339 111846 111847 111848 111849 111850 111851 112358 112359
##  [649] 112360 112361 112362 112363 112870 112871 112872 112873 112874
##  [658] 113382 113383 113384 113385 113386 113894 113895 113896 113897
##  [667] 113898 114406 114407 114408 114409 114918 114919 114920 114921
##  [676] 115430 115431 115432 115434 115942 115943 115944 115946 116454
##  [685] 116455 116457 116459 116966 116968 116969 117479 117480 117481
##  [694] 117991 117992 117993 118503 118504 118506 119015 119016 119527
##  [703] 119529 120039 120041 120551 120553 120578 121063 121066 121090
##  [712] 121576 121600 121602 122088 122112 122113 122601 122624 122625
##  [721] 123113 123136 123137 123646 123648 123649 123650 124158 124160
##  [730] 124161 124162 124670 124671 124673 124674 125182 125183 125184
##  [739] 125186 125694 125695 125696 125697 126206 126207 126208 126209
##  [748] 126211 126718 126719 126720 126721 126722 127230 127231 127232
##  [757] 127233 127234 127742 127743 127744 127745 127746 128254 128255
##  [766] 128256 128257 128258 128259 128766 128767 128768 128769 128770
##  [775] 128771 129278 129279 129280 129281 129282 129283 129790 129791
##  [784] 129792 129793 129794 129795 129796 130302 130303 130304 130305
##  [793] 130306 130307 130308 130814 130815 130816 130817 130818 130819
##  [802] 130820 131327 131328 131329 131330 131331 131332 131333 131839
##  [811] 131840 131841 131842 131843 131844 131845 132351 132352 132353
##  [820] 132354 132355 132356 132357 132358 132863 132864 132865 132866
##  [829] 132867 132868 132869 132870 133375 133376 133377 133378 133379
##  [838] 133380 133381 133382 133887 133888 133889 133890 133891 133892
##  [847] 133893 133894 134399 134400 134401 134402 134403 134404 134405
##  [856] 134406 134911 134912 134913 134914 134915 134916 134917 134918
##  [865] 135423 135424 135425 135426 135427 135428 135429 135430 135431
##  [874] 135935 135936 135937 135938 135939 135940 135941 135942 135943
##  [883] 136447 136448 136449 136450 136451 136452 136453 136454 136455
##  [892] 136958 136959 136960 136961 136962 136963 136964 136965 136966
##  [901] 137470 137471 137472 137473 137474 137475 137476 137477 137478
##  [910] 137479 137982 137983 137984 137985 137986 137987 137988 137989
##  [919] 137990 137991 138494 138495 138496 138497 138498 138499 138500
##  [928] 138501 138502 138503 139006 139007 139008 139009 139010 139011
##  [937] 139012 139013 139014 139015 139518 139519 139520 139521 139522
##  [946] 139523 139524 139525 139526 139527 140030 140031 140032 140033
##  [955] 140034 140035 140036 140037 140038 140039 140542 140543 140544
##  [964] 140545 140546 140547 140548 140549 140550 141054 141055 141056
##  [973] 141057 141058 141059 141060 141061 141062 141566 141567 141568
##  [982] 141569 141570 141571 141572 141573 141574 142078 142079 142080
##  [991] 142081 142082 142083 142084 142085 142086 142590 142591 142592
## [1000] 142593 142594 142595 142596 142597 142598 143102 143103 143104
## [1009] 143105 143106 143107 143108 143109 143110 143614 143615 143616
## [1018] 143617 143618 143619 143620 143621 143622 144126 144127 144128
## [1027] 144129 144130 144131 144132 144133 144134 144638 144639 144640
## [1036] 144641 144642 144643 144644 144645 144646 145150 145151 145152
## [1045] 145153 145154 145155 145156 145157 145158 145662 145663 145664
## [1054] 145665 145666 145667 145668 145669 145670 146174 146175 146176
## [1063] 146177 146178 146179 146180 146181 146182 146686 146687 146688
## [1072] 146689 146690 146691 146692 146693 146694 147198 147199 147200
## [1081] 147201 147202 147203 147204 147205 147206 147710 147711 147712
## [1090] 147713 147714 147715 147716 147717 147718 148222 148223 148224
## [1099] 148225 148226 148227 148228 148229 148230 148734 148735 148736
## [1108] 148737 148738 148739 148740 148741 148742 149246 149247 149248
## [1117] 149249 149250 149251 149252 149253 149254 149758 149759 149760
## [1126] 149761 149762 149763 149764 149765 149766 150270 150271 150272
## [1135] 150273 150274 150275 150276 150277 150278 150782 150783 150784
## [1144] 150785 150786 150787 150788 150789 150790 151294 151295 151296
## [1153] 151297 151298 151299 151300 151301 151302 151806 151807 151808
## [1162] 151809 151810 151811 151812 151813 151814 152318 152319 152320
## [1171] 152321 152322 152323 152324 152325 152326 152830 152831 152832
## [1180] 152833 152834 152835 152836 152837 152838 153342 153343 153344
## [1189] 153345 153346 153347 153348 153349 153350 153854 153855 153856
## [1198] 153857 153858 153859 153860 153861 153862 154366 154367 154368
## [1207] 154369 154370 154371 154372 154373 154374 154878 154879 154880
## [1216] 154881 154882 154883 154884 154885 154886 155390 155391 155392
## [1225] 155393 155394 155395 155396 155397 155398 155902 155903 155904
## [1234] 155905 155906 155907 155908 155909 155910 156414 156415 156416
## [1243] 156417 156418 156419 156420 156421 156422 156926 156927 156928
## [1252] 156929 156930 156931 156932 156933 156934 157438 157439 157440
## [1261] 157441 157442 157443 157444 157445 157446 157950 157951 157952
## [1270] 157953 157954 157955 157956 157957 157958 158462 158463 158464
## [1279] 158465 158466 158467 158468 158469 158470 158974 158975 158976
## [1288] 158977 158978 158979 158980 158981 159486 159487 159488 159489
## [1297] 159490 159491 159492 159493 159998 159999 160000 160001 160002
## [1306] 160003 160004 160005 160510 160511 160512 160513 160514 160515
## [1315] 160516 160517 161022 161023 161024 161025 161026 161027 161028
## [1324] 161029 161534 161535 161536 161537 161538 161539 161540 161541
## [1333] 162046 162047 162048 162049 162050 162051 162052 162053 162558
## [1342] 162559 162560 162561 162562 162563 162564 162565 163070 163071
## [1351] 163072 163073 163074 163075 163076 163077 163582 163583 163584
## [1360] 163585 163586 163587 163588 163589 164094 164095 164096 164097
## [1369] 164098 164099 164100 164101 164606 164607 164608 164609 164610
## [1378] 164611 164612 164613 165118 165119 165120 165121 165122 165123
## [1387] 165124 165125 165630 165631 165632 165633 165634 165635 165636
## [1396] 165637 166142 166143 166144 166145 166146 166147 166148 166654
## [1405] 166655 166656 166657 166658 166659 166660 167166 167167 167168
## [1414] 167169 167170 167171 167172 167678 167679 167680 167681 167682
## [1423] 167683 167684 168191 168192 168193 168194 168195 168196 168197
## [1432] 168703 168704 168705 168706 168707 168708 169215 169216 169217
## [1441] 169218 169219 169220 169727 169728 169729 169730 169731 169732
## [1450] 170239 170240 170241 170242 170243 170244 170751 170752 170753
## [1459] 170754 170755 170756 171263 171264 171265 171266 171267 171268
## [1468] 171775 171776 171777 171778 171779 172287 172288 172289 172290
## [1477] 172291 172799 172800 172801 172802 172803 173311 173312 173313
## [1486] 173314 173315 173823 173824 173825 173826 173827 174335 174336
## [1495] 174337 174338 174339 174847 174848 174849 174850 174851 175359
## [1504] 175360 175361 175362 175363 175871 175872 175873 175874 175875
## [1513] 176383 176384 176385 176386 176387 176895 176896 176897 176898
## [1522] 176899 177407 177408 177409 177410 177411 177919 177920 177921
## [1531] 177922 177924 178431 178432 178433 178434 178436 178943 178944
## [1540] 178945 178946 178948 179455 179456 179457 179458 179460 179967
## [1549] 179968 179969 179970 180479 180480 180481 180482 180991 180992
## [1558] 180993 180994 181503 181504 181505 181507 182015 182016 182018
## [1567] 182019 182527 182529 182530 182531 183039 183041 183042 183043
## [1576] 183552 183553 183554 183555 184064 184065 184066 184068 184576
## [1585] 184577 184578 184580 185088 185089 185090 185600 185601 185602
## [1594] 186112 186113 186115 186624 186625 186627 187136 187138 187139
## [1603] 187648 187650 187651 188160 188162 188163 188673 188674 188675
## [1612] 189185 189186 189188 189697 189698 189700 190209 190210 190212
## [1621] 190721 190722 190724 191233 191234 191745 191747 192257 192259
## [1630] 192769 192771 193281 193283 193793 193795 194305 194307 194817
## [1639] 194819 195329 195331 195841 195843 196353 196356 196865 196868
## [1648] 197377 197380 197743 197892 198255 198404 198767 198916 199278
## [1657] 199428 199790 199940 200302 200452 200814 200964 201326 201476
## [1666] 201838 201988 202350 202500 202862 203012 203374 203524 203886
## [1675] 204036 204399 204548 204911 205060 205570 205572 206082 206085
## [1684] 206594 206597 207106 207618 208130 208642 209155 209667 210179
## [1693] 210691 211204 211716 212228 212741 213253 231037 231549 232061
## [1702] 232573 233085 233597 234110 258292 258804 259316 259827 260339
## [1711] 260851 261363 261875

Image 3

img5<-readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric3.jpg")
gaborfiltered<-gabor.filter(img5,30,0,3,0,1,TRUE)

img6<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img6[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img6[i,j] > rowsucl | img6[i,j] < rowslcl){
      img6[i,j] <- 0}}}
which(img6 == 0)
##  [1] 130797 130798 131306 131307 131308 131311 131815 131816 131817 131830
## [11] 131831 131832 131833 132315 132316 132326 132340 132341 132346 132826
## [21] 132829 133342 133349 133363 133371 134361 134367 136946 137475 137986
## [31] 221493 221494 221495 221496 222004 222515 222521 224050 226704 226705
## [41] 226706 227219 228244 230805 235161

Image 4

img7<-readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric4.jpg")
gaborfiltered<-gabor.filter(img7,30,0,3,0,1,TRUE)

img8<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img8[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img8[i,j] > rowsucl | img8[i,j] < rowslcl){
      img8[i,j] <- 0}}}
which(img8 == 0)
##  [1]  10865  11378  11891  46956  47469  47979  48471  48984  92868 111426
## [11] 111427 133596 133597 134097 134098 134619 134622 175017 175018 176040
## [21] 176555 192293 192804 194339 242621 242622 243135 243644 244657 244658
## [31] 244672 245680 249432 249433 249943 249956 249957 250458 250982 251888
## [41] 251889 251980 251981 252914 253006 253497 255034 258619

Image 5

img9 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric5.jpg")
gaborfiltered<-gabor.filter(img9,30,0,3,0,1,TRUE)

img10<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img10[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img10[j,i] > columnsucl | img10[j,i] < columnslcl){
      img10[j,i] <- 0}}}
which(img10 == 0)
##   [1]   3616   4128   4640   5151   5663   6175   6687   7199   7711   8223
##  [11]   8735   9247   9759  10272  10784  11296  11808  12320  12832  13344
##  [21]  13856  14368  26729  27240  27751  28263  28774  29285  29796  30308
##  [31]  30819  31330  31842  32354  32865  33377  33889  34311  34822  35333
##  [41]  35845  36357  36868  37380  37892  38404  38916  39428  39940  40452
##  [51]  40964  41476  41988  42500  43012  43524  44036  44548  45061  45573
##  [61]  52817  53329  53840  54352  54864  55376  55889  56401  68618  69129
##  [71]  69641  70153  70665  71176  71688  72200  72712  73224  73736  74249
##  [81]  83971  84483  84994  85506  86018  86530  87042  87554  88066  88578
##  [91]  89090  89603  90115  90628  91141  93704  94216  94728  95240  95752
## [101]  96264  96776  97288  97800  98312  98824  99336  99849 100361 101263
## [111] 101775 102287 124908 125420 125442 125953 126465 126977 127489 128001
## [121] 128513 129025 129537 130049 130561 131073 131585 132098 132611 144391
## [131] 144902 145414 145925 146437 146948 147460 147972 148483 148995 149507
## [141] 150019 150530 151042 151554 152066 152578 153090 153602 154115 154627
## [151] 155140 171011 171523 172034 172546 173058 173570 174082 174594 175106
## [161] 175618 176130 176642 177154 177666 178178 178690 179202 179714 180226
## [171] 180738 181251 181763 182275 182788 203635 204147 204659 205171 234745
## [181] 235257 235769 236281 239193 239705 240217 240728 241240 241752 242264
## [191] 242776 243288 243800 244312 244824 245336 245849 246361 246873 247385
## [201] 247897 248409 248922 249434 249946 250459

Image 6

img11 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric6.jpg")
gaborfiltered<-gabor.filter(img11,30,0,3,0,1,TRUE)

img12<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img12[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img12[j,i] > columnsucl | img12[j,i] < columnslcl){
      img12[j,i] <- 0}}}
which(img12 == 0)
##   [1]  41465  41977  42488  43000  43512  44024  44536  45048  45560  46073
##  [11]  46585  47097  47610  48122  48635  58490  59002  59513  60025  60537
##  [21]  61049  61561  62073  62585  63097  76922  77433  77945  78457  78969
##  [31]  79481  79993  80505  81017  83331  83842  84354  84866  85378  85890
##  [41]  86402  88697  89209  89721  90232  90744  91256  91768  91770  92280
##  [51]  92282  92792  92794  93304  93306  93816  93818  94329  94841  95353
##  [61]  95865  96377  96890 118191 118702 119214 119726 120238 120239 120750
##  [71] 120751 121262 121263 121774 121775 122286 122798 123310 132726 133238
##  [81] 133749 133751 134261 134262 134772 134774 135284 135285 135796 135797
##  [91] 136308 136309 136820 136821 137332 137333 137844 137845 138356 138357
## [101] 138868 138869 139380 139382 139892 139894 140404 140917 141429 141941
## [111] 142454 176137 176648 177160 177672 178184 178697 179209 208660 209171
## [121] 209683 210194 210706 210708 211218 211220 211729 211732 212241 212244
## [131] 212753 213265 213778 214290 214803 225587 226098 226610 240910 241422
## [141] 241934 242446 246970 247482 247994 248506 249018

Image 7

img13 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric7.jpg")
gaborfiltered<-gabor.filter(img13,30,0,3,0,1,TRUE)

img14<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img14[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img14[j,i] > columnsucl | img14[j,i] < columnslcl){
      img14[j,i] <- 0}}}
which(img14 == 0)
##   [1]  20831  21342  21854  22365  22877  23388  23900  24412  24923  25435
##  [11]  25947  26459  26971  27483  27995  28506  29018  29530  30042  30555
##  [21]  31067  31579  32091  32604  37614  38125  38637  39148  39660  40172
##  [31]  40684  41196  41708  42220  42732  43244  43756  44268  44780  45292
##  [41]  45804  46316  46828  47340  47626  48137  48649  49161  49673  50185
##  [51]  50697  51210  52218  52730  53243  97849  98360  98872  99384  99896
##  [61] 100408 100920 101433 101945 102458 111812 112323 112835 113347 113859
##  [71] 114371 114883 115395 115907 116419 159240 159752 160264 160776 176685
##  [81] 177197 177709 178221 181776 182287 182799 183311 183822 184334 184846
##  [91] 185358 185870 186383 186895 187407 187920 188432 194785 195296 195808
## [101] 196320 196832 197344 197857 206780 207291 207803 208314 208826 209338
## [111] 209850 210362 210365 210874 210876 211386 211388 211898 211900 212410
## [121] 212412 212922 212924 213434 213436 213946 213948 214458 214461 214970
## [131] 214974 215482 215995 216507 217009 217521 218033 218545 219057 219570
## [141] 220082 220595 222177 222688 223200 223712 224224 224736 225248 225760
## [151] 226271 226783 227295 227807 228319 228831 229342 229854 230366 230777
## [161] 231288 231800 232312 232824 233336 233848 234361 234874 235487 235999
## [171] 236511 237024 237536 238048 238561 239073 239586

Image 8

img15 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric8.jpg")
gaborfiltered<-gabor.filter(img15,30,0,3,0,1,TRUE)

img16<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img16[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img16[j,i] > columnsucl | img16[j,i] < columnslcl){
      img16[j,i] <- 0}}}
which(img16 == 0)
##   [1]  20057  20569  21081  21593  22105  22617  23129  23642  24154  24666
##  [11]  25178  25691  59911  60422  60934  61446  61958  62470  62982  63494
##  [21]  64006  64518  65030  65542  66054  66566  67078  67590  68102  68614
##  [31]  69127  69639  70151  70663  71175  71687  72199  72712  73224  73736
##  [41]  74248  74760  75272  75784  76296  76809  77321  77833  78345  78857
##  [51]  79369  79881  80393  80905  81417  81929  82442 138234 138746 139258
##  [61] 139770 139784 140296 140808 141319 141831 142343 142855 143367 143879
##  [71] 144391 144902 145414 145926 146438 146950 147462 147974 148486 148998
##  [81] 149510 150022 150534 151046 151558 152070 152582 153094 153606 154118
##  [91] 154630 155143 155655 156167 156679 157191 157703 158215 158727 159239
## [101] 159751 160263 160775 161287 161799 162311 162823 163335 163847 164359
## [111] 164871 165382 165895 166407 166919 167431 167943 168455 168968 169480
## [121] 169992 170504 171016 171528 172040 172552 173064 173576 174088 174600
## [131] 175113 175625 176137 176649 177162 201300 201812 202324 202835 203347
## [141] 203859 204372 204884 205342 205854 206366 206878 207391 210423 210934
## [151] 211445 211956 212468 212979 213491 214003 214514 215026 215538 216050
## [161] 216561 217073 217586 218098 218610 219123 219635 220148 234075 234587
## [171] 235098 235610 236122 236634 237146 237658 238141 238652 239164 239676
## [181] 240188 240700 241212 241724 242237 242749 244464

Image 9

img17 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric9.jpg")
gaborfiltered<-gabor.filter(img17,30,0,3,0,1,TRUE)

img18<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img18[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img18[j,i] > columnsucl | img18[j,i] < columnslcl){
      img18[j,i] <- 0}}}
which(img18 == 0)
##   [1]    345    857   1368   1880   2393   2905  33621  34132  34643  35155
##  [11]  35667  36178  36690  37202  37714  38226  38738  39251  39763  40275
##  [21]  40787  41299  41812  45992  46504  47015  47527  48039  48551  49063
##  [31]  56826  57336  57848  58359  58871  59383  59895  60408  60920  61432
##  [41]  61945  62457  62970  63482  63995  69118  69630  70142  70654  71166
##  [51]  71677  72189  72701  73213  73464  73975  74487  74999  75511  76023
##  [61]  76535  77047  77560 117395 117907 118418 118930 119442 121968 122479
##  [71] 122991 123503 124015 124528 125040 125552 126064 126576 127088 127601
##  [81] 128113 128625 129365 129877 130388 130900 131413 131925 136559 137070
##  [91] 137581 138093 138605 138606 139117 139118 139629 139630 140141 140142
## [101] 140653 140654 141165 141167 141678 141679 142190 142702 143215 143727
## [111] 144240 144753 150595 151106 151618 152129 152641 153153 153666 154178
## [121] 154690 197154 197666 198178 198690 199202 199715 200227 200739 201251
## [131] 201763 202276 208153 208665 209177 233566 234077 234589 235101 235613
## [141] 236125 236637 237149 237662 243723 244235 244746 245258 245770 246282
## [151] 246794 247306 261465 261977

Image 10

img19 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric10.jpg")
gaborfiltered<-gabor.filter(img19,30,0,3,0,1,TRUE)

img20<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img20[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img20[j,i] > columnsucl | img20[j,i] < columnslcl){
      img20[j,i] <- 0}}}
which(img20 == 0)
##   [1]  97141  97653  98165  98678 109898 110410 110922 118791 119302 119814
##  [11] 120326 120838 121349 121861 122373 122885 123397 123909 124421 124933
##  [21] 125445 125957 126469 126981 127493 128006 128518 158120 158632 159143
##  [31] 159655 160167 160679 161191 161702 162214 162726 163238 163750 164262
##  [41] 164774 165286 165799 166311 166823 167336 167848 169534 170046 170558
##  [51] 183984 184495 185007 185519 186031 186543 187055 187567 188079 188591
##  [61] 189103 189615 190127 190640 193084 193595 194106 194618 195130 195642
##  [71] 196154 196666 197178 197690 198202 198714 199227 199740 208561 209073
##  [81] 209584 210096 210608 211120 211632 212144 212656 213168 213679 214191
##  [91] 214703 215215 215727 216239 216751 217262 217774 218286 218798 219310
## [101] 219822 220335 220847 230923 231435 231947 232459 232971 253641 254152
## [111] 254664 255176 255688 256199 256711 257223 257735 258247 258760 259272
## [121] 259784 260296 260809

Image 11

img21 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric11.jpg")
gaborfiltered<-gabor.filter(img21,30,0,3,0,1,TRUE)

img22 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img22[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img22[i,j] > rowsucl | img22[i,j] < rowslcl){
      img22[i,j] <- 0}}}
which(img22 == 0)
##  [1]   1171   1172   1173   2194   8563   8564   9074   9589  14040  14041
## [11]  14551  16433  16598  84753  84754  85264  85267 169591 169592 169593
## [21] 169594 170107 170620 171645 173182

Image 12

img23 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric12.jpg")
gaborfiltered<-gabor.filter(img23,30,0,3,0,1,TRUE)

img24 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img24[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img24[i,j] > rowsucl | img24[i,j] < rowslcl){
      img24[i,j] <- 0}}}
which(img24 == 0)
##   [1]  32002  32514  32515  33025  33026  33027  33537  33538  33539  34049
##  [11]  34050  34051  34561  34562  34563  35073  35074  35075  35585  35586
##  [21]  35587  36097  36098  36609  36610  37122  55551  55552  56063  56064
##  [31]  56574  56575  56576  57070  57086  57087  57088  57582  57597  57598
##  [41]  57599  57600  58093  58094  58109  58110  58111  58112  58621  58622
##  [51]  58623  58624  59117  59132  59133  59134  59135  59136  59644  59645
##  [61]  59646  59647  59648  60156  60157  60158  60159  60160  60668  60669
##  [71]  60670  60671  61181  61182  61183  61693  61694 153358 153359 153869
##  [81] 153870 153871 153872 154381 154382 154383 154384 154385 154893 154894
##  [91] 154895 154896 154897 155405 155406 155407 155408 155409 155916 155917
## [101] 155918 155919 155920 155921 156428 156429 156430 156431 156432 156433
## [111] 156434 156941 156942 156943 156944 156945 157453 157454 157455 157456
## [121] 157457 157965 157966 157967 157968 158477 158478 158479 158480 158990
## [131] 158991 158992 162250 215281 215793 216305 216818 217330 249519 249520

Image 13

img25 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric13.jpg")
gaborfiltered<-gabor.filter(img25,30,0,3,0,1,TRUE)

img26 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img26[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img26[i,j] > rowsucl | img26[i,j] < rowslcl){
      img26[i,j] <- 0}}}
which(img26 == 0)
##   [1]     15     16     17     18     19     84     85     86     95     96
##  [11]     97    107    108    109    110    342    343    344    345    346
##  [21]    347    348    349    365    366    367    368    369    370    371
##  [31]    372    379    380    391    392    393    394    395    413    414
##  [41]    415    416    417    418    461    462    463    464    471    472
##  [51]    473    474    475    483    484    485    486    487    488    489
##  [61]    506    507    508    509    510    551    599    623    857    858
##  [71]    880    881    882    997    998    999   1064   1122   1371   2601
##  [81]  16622  17133  17135  71414  71925 109772 110283 110285 111822 144850
##  [91] 145363 145873 170631 170632 170633 171142 171653 171658 172481 172482
## [101] 172483 172676 172992 174215 175039 205733 246275 246276 246789 247814
## [111] 248094 248605 248607 249351 258666 260054 260622 262116 262122

Image 14

img27 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric14.jpg")
gaborfiltered<-gabor.filter(img27,30,0,3,0,1,TRUE)

img28 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img28[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img28[i,j] > rowsucl | img28[i,j] < rowslcl){
      img28[i,j] <- 0}}}
which(img28 == 0)
##  [1]  27559  27560  38897  39922  40432  47408  47921 105663 105664 106174
## [11] 106689 107197 107338 107849 107851 108360 108732 108876 113339 123931
## [21] 127760 128271 128785 142573 229896 230409

Image 15

img29 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric15.jpg")
gaborfiltered<-gabor.filter(img29,30,0,3,0,1,TRUE)

img30<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img30[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img30[j,i] > columnsucl | img30[j,i] < columnslcl){
      img30[j,i] <- 0}}}
which(img30 == 0)
##   [1]  21309  21821  22333  22845  23357  31370  31880  32392  32903  33415
##  [11]  33926  34438  34950  35462  35975  36487  58780  59292  59803  60315
##  [21]  60827  61339  61851  62363  62875  63387  63899  64412  64924  77655
##  [31]  78167  78678  79190  79703  90038  90550  91062  91574  92086  92598
##  [41]  93110  93622  94134  94646  95158  95670  96182  96694  97206  97718
##  [51]  98230  98742  99254  99766 100278 101387 101898 102410 102921 103433
##  [61] 103945 104457 104460 104969 104971 105481 105483 105993 105995 106505
##  [71] 106507 107017 107018 107529 107531 108041 108043 108553 108555 109065
##  [81] 109067 109577 110089 110601 111113 111626 112138 112816 113327 113839
##  [91] 114350 114862 115374 115886 116399 116911 117424 122270 122781 123293
## [101] 123805 152536 153047 153559 154071 154583 155095 155212 155723 156235
## [111] 156747 157259 157771 158283 158794 159306 159818 160330 160843 161355
## [121] 161867 162379 162891 163403 163916 164428 164940 165452 165965 166477
## [131] 166989 167502 174202 174714 175225 175737 176249 176761 177273 177785
## [141] 178297 178809 179321 179833 180345 203404 203915 204427 204939 205451
## [151] 205963 206475 206987 207499 218953 219465 219976 220488

Image 16

img31 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric16.jpg")
gaborfiltered<-gabor.filter(img31,30,0,3,0,1,TRUE)

img32<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img32[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img32[j,i] > columnsucl | img32[j,i] < columnslcl){
      img32[j,i] <- 0}}}
which(img32 == 0)
##   [1]      1    513   1025   1537   2049   2561   3073   3585   4097   4609
##  [11]   5121   5633   6145   6657   7169   7681   8193   8705   9217   9729
##  [21]  10241  10753  11265  11777  12289  12801  13313  13825  14337  14849
##  [31]  15361  15873  16385  16897  17409  17921  18433  18945  19457  19969
##  [41]  20481  20993  21505  22017  22529  23041  23553  24065  24577  25089
##  [51]  25601  26113  26625  27137  27649  28161  28673  29185  29697  30209
##  [61]  30721  31233  31745  32257  32769  33281  33793  34305  34817  35329
##  [71]  35841  36353  36865  37377  37889  38401  38913  39425  39937  40449
##  [81]  40961  41473  41985  42497  43009  43521  44033  44545  45057  45569
##  [91]  46081  46593  47105  47617  48129  48641  49153  49665  50177  50689
## [101]  51201  51713  52225  52737  53249  53761  54273  54786  55298  56304
## [111]  56817  61442  61953  62465  62977  63489  64001  64513  65025  65537
## [121]  66049  66561  67073  67585  68097  68609  69121  69633  70145  70657
## [131]  71169  71681  72193  72705  73217  73729  74241  74753  75265  75777
## [141]  76289  76801  77313  77825  78337  78849  79361  79873  80385  80897
## [151]  81409  81921  82433  82945  83457  83969  84481  84993  85505  86017
## [161]  86529  87041  87553  88065  88577  89089  89601  90113  90625  91137
## [171]  91649  92161  92673  93185  93697  94209  94721  95233  95745  96257
## [181]  96769  97281  97793  98305  98817  99329  99841 100353 100865 101377
## [191] 101889 102401 102913 103425 103937 104449 104961 105473 105985 106497
## [201] 107009 107521 108033 108545 109057 109569 110081 110593 111105 111617
## [211] 112129 112641 113153 113665 114177 114689 115201 115713 116225 116737
## [221] 117249 117761 118511 119022 119533 120044 120554 121065 121576 122088
## [231] 122599 123111 123622 124134 124646 124653 125157 125163 125669 125674
## [241] 126181 126185 126191 126693 126696 126700 127204 127207 127211 127716
## [251] 127719 127721 127726 128228 128230 128232 128236 128740 128742 128744
## [261] 128746 129252 129253 129255 129257 129260 129764 129765 129766 129768
## [271] 129771 130276 130277 130278 130280 130282 130788 130789 130790 130791
## [281] 130793 130796 131299 131300 131302 131303 131304 131307 131811 131812
## [291] 131813 131814 131816 131818 132323 132324 132325 132326 132328 132330
## [301] 132835 132836 132837 132838 132840 132841 133347 133348 133349 133350
## [311] 133352 133354 133859 133860 133861 133862 133864 133866 134371 134372
## [321] 134373 134374 134376 134883 134884 134885 134887 134888 135395 135397
## [331] 135398 135399 135401 135908 135909 135910 135912 136420 136421 136422
## [341] 136424 136932 136933 136935 136938 137444 137446 137448 137956 137958
## [351] 137961 138468 138471 138475 138980 138983 139493 139496 140005 140010
## [361] 140517 141030 141542 142055 142567 143080 143593 144107 145921 146433
## [371] 146945 147457 147969 148481 148993 149505 150017 150529 151041 151553
## [381] 152065 152577 153089 153601 154113 154625 155137 155649 156161 156673
## [391] 157185 157697 158209 158721 159233 159745 160257 160769 161281 161793
## [401] 162305 162817 163329 163841 164353 164865 165377 165889 166401 166913
## [411] 167425 167937 168449 168961 169473 169985 170497 171009 171521 172033
## [421] 172545 173057 173569 174081 174593 175105 175617 176129 176641 177153
## [431] 177665 178177 178689 179201 179713 180225 180737 181249 181761 182273
## [441] 182785 183297 183809 184321 184833 185345 185857 186369 186881 187393
## [451] 187905 188417 188929 189441 189953 190465 190977 191489 192001 192513
## [461] 193025 193537 194049 194561 195073 195585 196097 196609 197121 197633
## [471] 198145 198657 199169 199681 200193 200705 201217 201729 202241 202753
## [481] 203265 203777 204289 204801 205313 205825 206337 206849 207361 207873
## [491] 208385 208897 209409 209921 210433 210945 211457 211969 212481 212993
## [501] 213505 214017 214529 215041 215553 216065 216577 217089 217601 218113
## [511] 218625 219137 219649 220161 220673 221185 221697 222209 222721 223233
## [521] 223745 224257 224769 225281 225793 226305 226817 227329 227841 228353
## [531] 228865 229377 229889 230401 230913 231425 231937 232449 232961 233473
## [541] 233985 234497 235009 235521 236033 236545 237057 237569 238081 238593
## [551] 239105 239617 240129 240641 241153 241665 242177 242689 243201 243713
## [561] 244225 244737 245249 245761 246273 246785 247297 247809 248321 248833
## [571] 249345 249857 250369 250881 251393 251905 252417 253426 253938 254451
## [581] 256001 256513 257025 257537 258049 258561 259073 259585 260097 260609
## [591] 261121 261633

Image 17

img33 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric17.jpg")
gaborfiltered<-gabor.filter(img33,30,0,3,0,1,TRUE)

img34<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img34[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img34[j,i] > columnsucl | img34[j,i] < columnslcl){
      img34[j,i] <- 0}}}
which(img34 == 0)
##   [1]    437    438    949   1462   3117   3629   4140   4652   5164   5675
##  [11]   6187   6189   6699   6700   7211   7212   7723   7724   8235   8236
##  [21]   8746   8748   9258   9259   9770   9771  10282  10284  10794  10796
##  [31]  11306  11308  11818  12331  12843  13555  14067  14579  15091  15093
##  [41]  15602  15604  16114  16116  16626  16628  17138  17140  17650  17652
##  [51]  18162  18164  18674  18675  18677  19186  19187  19189  19698  19699
##  [61]  19700  20210  20211  20212  20722  20723  20724  21234  21235  21236
##  [71]  21237  21746  21747  21748  21749  22258  22259  22260  22261  22770
##  [81]  22771  22772  22773  23282  23283  23284  23285  23794  23795  23796
##  [91]  23797  24306  24307  24308  24309  24818  24819  24820  24821  25330
## [101]  25331  25332  25333  25842  25843  25844  25845  26171  26355  26356
## [111]  26357  26682  26867  26868  26869  27193  27379  27380  27381  27705
## [121]  27707  27891  27893  28217  28218  28404  28728  28730  28916  29240
## [131]  29242  29752  29753  30264  30266  30776  30778  31288  31290  31801
## [141]  32313  32827  40756  41268  41779  42291  42803  43315  43827  44339
## [151]  44851  45363  45876  46515  47026  47537  47539  48049  48050  48560
## [161]  48561  48562  49072  49073  49074  49584  49585  49586  49587  50096
## [171]  50097  50098  50099  50607  50608  50609  50610  50611  51119  51120
## [181]  51121  51122  51123  51631  51632  51633  51634  51635  52143  52144
## [191]  52145  52146  52147  52655  52656  52657  52658  52659  53167  53168
## [201]  53169  53170  53171  53679  53680  53681  53682  54191  54192  54193
## [211]  54194  54703  54704  54705  55216  55217  55218  55728  55729  56240
## [221]  56753  57869  58380  58892  59404  59916  60428  60940  61452  61964
## [231]  62476  62989  74747  75258  75770  76282  76794  76795  77305  77306
## [241]  77817  77818  78329  78330  78841  78842  79353  79354  79355  79864
## [251]  79865  79866  80376  80377  80378  80888  80889  80890  81400  81401
## [261]  81402  81912  81913  81914  82424  82425  82426  82936  82937  82938
## [271]  83448  83449  83450  83960  83961  83962  84472  84473  84474  84984
## [281]  84985  84986  85496  85497  85498  86008  86009  86010  86520  86521
## [291]  86522  87032  87033  87034  87544  87545  87546  88056  88057  88058
## [301]  88568  88569  89080  89081  89592  89593  90104  90105  90616  90617
## [311]  91129  91130  91641  91642  92153  92154  92665  93177  93689  94202
## [321] 133129 133640 134152 134664 135175 135177 135687 135689 136199 136201
## [331] 136711 136712 137223 137224 137735 137737 138247 138249 138759 139271
## [341] 139784 140296 140808 141321 141833 142618 142620 143130 143131 143132
## [351] 143641 143642 143643 143644 144153 144154 144155 144156 144157 144665
## [361] 144666 144667 144668 144669 145176 145177 145178 145179 145180 145181
## [371] 145182 145688 145689 145690 145691 145692 145693 145694 146200 146201
## [381] 146202 146203 146204 146205 146206 146712 146713 146714 146715 146716
## [391] 146717 146718 147224 147225 147226 147227 147228 147229 147230 147231
## [401] 147736 147737 147738 147739 147740 147741 147742 147743 148248 148249
## [411] 148250 148251 148252 148253 148254 148255 148760 148761 148762 148763
## [421] 148764 148765 148766 148767 149272 149273 149274 149275 149276 149277
## [431] 149278 149279 149784 149785 149786 149787 149788 149789 149790 149791
## [441] 150296 150297 150298 150299 150300 150301 150302 150303 150808 150809
## [451] 150810 150811 150812 150813 150814 150815 151320 151321 151322 151323
## [461] 151324 151325 151326 151832 151833 151834 151835 151836 151837 151838
## [471] 152344 152345 152346 152347 152348 152349 152350 152856 152857 152858
## [481] 152859 152860 152861 152862 153368 153369 153370 153371 153372 153373
## [491] 153881 153882 153883 153884 153885 154393 154394 154395 154396 154668
## [501] 154906 154907 155180 155692 156204 156716 157228 157740 158253 159228
## [511] 159740 160252 160253 160764 160765 161276 161277 161278 161788 161789
## [521] 161790 162299 162300 162301 162811 162812 162813 163323 163324 163325
## [531] 163835 163836 163837 164347 164348 164349 164859 164860 164861 165371
## [541] 165372 165373 165883 165884 166395 166396 166908 167420 178185 178697
## [551] 179209 179721 180233 180745 181257 181769 182281 182793 183306 191894
## [561] 192406 192918 193430 193431 193942 193943 194454 194455 194966 194967
## [571] 195478 195479 195990 195991 195992 196502 196503 196504 197014 197015
## [581] 197016 197526 197527 198038 198039 198550 198551 199062 199063 199574
## [591] 199576 199892 200404 200916 201428 201940 202647 206188 206700 207211
## [601] 207723 208235 208747 209260 209772 242275 242786 243298 243810 244322
## [611] 244834 245346 245858 246370 246883 247395 247907 248419 248931 249443
## [621] 249955 250468 250864 250980 251376 251492 252004 252517 253367 253879
## [631] 254390 254392 254902 254903 255413 255414 255925 255926 255927 256345
## [641] 256437 256438 256856 256949 256950 257368 257461 257462 257463 257880
## [651] 257973 257974 257975 258392 258394 258486 258487 258904 258906 258998
## [661] 258999 259417 259509 259510 259511 259929 260021 260022 260441 260533
## [671] 260534 260954 261045 261046 261556 261557 262068 262070

Image 18

img35 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric18.jpg")
gaborfiltered<-gabor.filter(img35,30,0,3,0,1,TRUE)

img36 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img36[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img36[i,j] > rowsucl | img36[i,j] < rowslcl){
      img36[i,j] <- 0}}}
which(img36 == 0)
##   [1]      1      8      9     10     11     12     13     14     34     35
##  [11]     36     37     38     47     48     58     59     60     61     62
##  [21]     63     70     71     72     73     74     75     81     82     83
##  [31]     84     85     86     87     96     97     98     99    100    107
##  [41]    108    109    110    111    112    180    181    182    183    194
##  [51]    195    196    197    239    240    241    242    264    265    266
##  [61]    267    268    269    270    277    278    279    280    281    302
##  [71]    303    304    305    313    314    315    316    324    325    326
##  [81]    327    328    329    335    336    337    338    339    340    341
##  [91]    342    343    349    350    351    352    353    354    355    356
## [101]    364    365    366    367    368    376    377    378    379    380
## [111]    381    389    390    391    392    401    402    403    404    405
## [121]    436    437    438    439    440    447    448    449    450    451
## [131]    452    453    460    461    462    463    464    465    466    467
## [141]    486    495    496    497    498    499    500    501    502    508
## [151]    509    510    511    512    551    829    881   1306   1624   1942
## [161]  21835  41343  41854  42368  69612  70123  70125  72686 106145 106146
## [171] 120065 120066 125685 125686 125687 125688 125689 126196 126202 126203
## [181] 126707 126716 126717 127742 137448 137449 137450 137959 137963 138982
## [191] 175583 175584 176094 176605 176609 177116 178139 183725 184236 184238
## [201] 184239 185259 185264 185275 185788 229771 229772 229773 230286 230794
## [211] 247814 248327 249983 258908 259178 259251 259777 259822 260142 260555
## [221] 260569 260570 260703 260884 261304 261375 261508 261681

Image 19

img37 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric19.jpg")
gaborfiltered<-gabor.filter(img37,30,0,3,0,1,TRUE)

img38<-gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    columns <- img38[,i]
    columnsucl <- mean(columns) + 3*sd(columns)
    columnslcl <- mean(columns) - 3*sd(columns)
    if(img38[j,i] > columnsucl | img38[j,i] < columnslcl){
      img38[j,i] <- 0}}}
which(img38 == 0)
##   [1]  12870  13381  13893  14404  14916  15428  15940  16452  16964  17476
##  [11]  17987  18499  19011  19523  20035  20547  21060  21572  22084  22597
##  [21]  25639  26150  26662  27174  27686  38735  39247  39759  40271  40783
##  [31]  41295  41808  42320  45569  46081  46593  47105  47617  48129  48641
##  [41]  49153  49665  50177  50701  53171  53683  54194  54706  55218  55730
##  [51]  56242  56755  57267  57779  58292  58805  59642  60154  68703  69214
##  [61]  69726  70238  70749  71261  71773  72285  72796  73308  73820  74332
##  [71]  74843  75355  75867  76379  76891  77403  77915  78427  78939  79451
##  [81]  79964  80476  80988  81501  82048  82560  83072  83584  84096  84608
##  [91]  85120  85631  86143  86655  87167  87679  88191  88703  93804  94316
## [101]  94828  95340  95852  96364  96876 103548 104060 118552 119063 119575
## [111] 120086 120598 121110 121622 121625 122134 122136 122646 122648 123158
## [121] 123160 123162 123670 123672 123674 124182 124184 124185 124694 124696
## [131] 124697 124699 125206 125208 125209 125211 125719 125720 125721 125723
## [141] 126231 126232 126233 126235 126743 126744 126746 126747 127255 127256
## [151] 127258 127259 127767 127769 127770 127772 128279 128281 128282 128792
## [161] 128793 128795 129304 129306 129308 129816 129818 130300 130331 130811
## [171] 130845 131293 131804 132316 132828 132859 133339 133342 133851 133854
## [181] 134364 134366 134876 134877 134908 135388 135389 135420 135900 135902
## [191] 135931 136412 136414 136443 136924 136926 136956 137436 137438 137948
## [201] 137950 138461 138462 138973 138974 139485 139487 139997 139999 140509
## [211] 140511 141021 141024 141533 141536 142046 142558 143070 143582 144094
## [221] 144606 145119 145631 146143 146655 147167 147680 148192 148705 154524
## [231] 155036 155547 156059 156570 156867 157378 157890 158402 158914 159426
## [241] 159938 160451 162624 163135 163647 164159 164671 165184 165696 166209
## [251] 167517 168029 168541 169053 169565 170077 170589 171101 171613 172125
## [261] 172638 173150 173662 174175 174687 175200 193966 194478 194990 195502
## [271] 196014 222098 222610 223121 223632 224144 224655 225167 225678 226190
## [281] 226702 227214 227726 228239 231874 232386 232897 233409 247152 247664
## [291] 248175 248687 249199 249711 250222 250735 251247 251744 252256 252767
## [301] 253279 253791 254303 254815

Image 20

img39 <- readJPEG("C:/Users/ilker zeybek/Desktop/grayscale images/Fabric20.jpg")
gaborfiltered<-gabor.filter(img39,30,0,3,0,1,TRUE)

img40 <- gaborfiltered$filtered_img
for(i in 1:512){
  for(j in 1:512){
    rows <- img40[i,]
    rowsucl <- mean(rows) + 3*sd(rows)
    rowslcl <- mean(rows) - 3*sd(rows)
    if(img40[i,j] > rowsucl | img40[i,j] < rowslcl){
      img40[i,j] <- 0}}}
which(img40 == 0)
##   [1]  43553  43554  44064  45087  62632  63143  64169  77376  77887  77889
##  [11] 105765 106278 108273 109298 111347 112174 112175 112685 113708 113908
##  [21] 115243 115423 115445 115446 115934 115959 115960 116445 116473 116474
##  [31] 116987 117468 117481 117482 117483 117484 117485 117486 117500 117992
##  [41] 117999 118013 118503 118506 118507 118526 118911 118983 118984 118985
##  [51] 118986 119003 119014 119017 119020 119021 119422 119424 119525 119528
##  [61] 119536 119551 120011 120039 120042 120043 120046 120524 120553 120556
##  [71] 120570 120957 121037 121060 121062 121064 121083 121088 122062 122087
##  [81] 122090 122093 122575 122576 122584 122597 122601 123089 123090 123091
##  [91] 123092 123093 123094 123095 123097 123107 123137 143112 143623 252850

4. Results and Discussion

Out of control pixels are detected and shown with the which() function. The number represented after the which() function is the index numbers of the out of control pixels when you think the image as a vector.

In this process, I have used the row or columns for control charts, but in the real world with large amount of images, choosing the images manually will be hard task to do. In order to do this method efficiently, there should be a way to automatically seperate images as horizontally oriented or vertically oriented. Machine learning can be used to seperate images and to apply appropriate control chart provided in the approach section.

5. Conclusions and Future Work

To have a better approach with current control chart methods that stated in approach section, I have to apply machine learning to seperate images as horizontal oriented or vertical oriented. Since it is a hard task to do, another approach could be using sliding windows with fixed size (for example 51x51) to calculate control charts for each window.

BIBLIOGRAPHY

“What Is Linen Fabric?” https://sewport.com/fabrics-directory/linen-fabric

S. Sahaya Tamil Selvi, G. M. Nasira. “An Effective Automatic Fabric Defect Detection System using Digital Image Processing”